package com.cmc.cloud.cmclink.doc.api.document.rep;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import java.util.Date;

/**
 * @author 周贤
 * @date 2025/3/12
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class BaseCodeRpcRepDto {

    @Schema(description = "主键")
    private Long id;

    @Schema(description = "代码")
    private String code;

    @Schema(description = "代码类型", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "代码类型不能为空")
    @Length(max = 50, message = "代码类型支持最大长度{max}")
    private String codeCategory;

    @Schema(description = "中文名称")
    @Length(max = 50, message = "中文名称支持最大长度{max}")
    private String descCn;

    @Schema(description = "英文名称")
    @Length(max = 50, message = "英文名称支持最大长度{max}")
    private String descEn;

    @Schema(description = "网厅显示")
    private Boolean ebShow;

    @Schema(description = "港口")
    @Length(max = 5, message = "港口支持最大长度{max}")
    private String portCode;

    @Schema(description = "排序号")
    @Length(max = 20, message = "排序号支持最大长度{max}")
    private String sortNo;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @Schema(description = "创建人")
    private String creator;

    @Schema(description = "操作时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    @Schema(description = "操作人")
    private String updater;
}
